package com.example.demo.admin.controller;/**
 * Created by kete on 2017-11-16.
 */

import com.example.demo.common.persistence.dao.DeptMapper;
import com.example.demo.core.controller.BaseController;
import com.example.demo.core.ztree.ZTreeNode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 作者：kete
 * 创建时间：2017-11-16 11:41
 * 功能描述：
 * 版本：
 */
@Controller
@RequestMapping(value = "/dept")
public class DeptController extends BaseController {

    @Autowired
    DeptMapper deptMapper;

    @RequestMapping(value = "/tree")
    @ResponseBody
    public Object deptTree(){
        List<ZTreeNode> list = deptMapper.deptTree();
        list.add(ZTreeNode.createParent());
        return list;
    }
}
